﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EDMDesigner.Business.CSDL.Property.Complex;
using EDMDesigner.UIBusiness.CSDL.Type;
using EDMDesigner.UIBusiness.CSDL.Property;

namespace EDMDesigner.Designer.Controls.CSDLType
{
    public class ComplexTypeDesigner : TypeBaseDesigner
    {
        public ComplexTypeDesigner(UIComplexType complexType)
            : base(complexType)
        {
            ComplexType = complexType;
        }

        public UIComplexType ComplexType { get; private set; }

        protected override void DrawRelation(UIRelatedProperty relatedProperty)
        {
            base.DrawRelation(relatedProperty);
            foreach (var typeDesigner in Designer.Children.OfType<TypeBaseDesigner>().ToList())
                typeDesigner.DrawComplexPropertyRelation(this, relatedProperty);
        }
    }
}
